<%@ include file = "/common/ini.jsp"%> 
<%@ include file = "/common/_log4j.jsp"%>
<%@ include file = "/common/_ApplicationContext_init.jsp"%>
<%@ include file = "/common/_vr.jsp"%> 
<%@ include file = "/js/_js_for_select.jsp"%>
<%
    // 定义名称
    String title = "新增类别";
    String remark = "";
    TypeManager typeManager = (TypeManager)applicationContext.getBean("typeManager");
%>
<script>
    function submitData()
    {
        detailForm.serviceURL.value = "basedata.type.NewTypeService";
        detailForm.submit();
    }
    function reset()
    {
        delAllOptions(detailForm.parentId);
        addOption(detailForm.parentId,"null","无");
        <%
        String parentId = null;
        Type superType = (Type)typeManager.get(request.getParameter("parentId") + "");
        if(superType != null)
        {
            
            parentId = superType.getId();
            %>
                addOption(detailForm.parentId,"<%= superType.getId()%>","<%= superType.getName()%>");
                detailForm.code.value = "<%= superType.getCode()%>";
            <%
        }
        if(vr.isAllValidated())    
        {
            %>
            detailForm.id.value = "";
            detailForm.name.value = "";
            detailForm.parentId.value = "<%= request.getParameter("parentId")%>";
            detailForm.remark.value = "";
            <%
        }
        else
        {
            %>
            detailForm.id.value = "<%= request.getParameter("id")%>";
            detailForm.name.value = "<%= request.getParameter("name")%>";
            detailForm.code.value = "<%= request.getParameter("code")%>";
            detailForm.parentId.value = "<%= request.getParameter("parentId")%>";
            <% remark = request.getParameter("remark");%>
            detailForm.remark.value = tempRemark.value;
            <%
        }    
        %>
    }
    function bodyLoadJS()
    {
        // 被聚焦的控件
        detailForm.code.focus(); 
    }
</script>
<%@ include file = "/common/detail/_OnForm.jsp"%> 
<%@ include file = "_detail.jsp"%> 
<%@ include file = "/common/detail/_UnderForm.jsp"%> 
